package third;
import java.util.Scanner;
import java.lang.String;
public class Fruit {
    float weight;
    String color;

   Fruit (float w)
    {
        this.weight=w;
    }

    public float getWeight(float g) {
        return  this.weight;
    }

    public String getColor(float k) {
        return color;
    }
    public static void main(String[] args) {
        System.out.println("---------*打印出你选择的水果的信息*------------");
        float a,d,average;
        String b,e;
        Scanner in =new Scanner(System.in);
        a=in.nextFloat();//
        b=in.next();
        d=in.nextFloat();//
        e=in.next();
        Fruit f1=new Fruit(a);
        Fruit f2=new Fruit(d);
        average=(f1.getWeight(a)+f2.getWeight(d))/2;
        System.out.println("Apple的颜色为"+b+" "+"重量是"+a);
        System.out.println("banana的颜色为"+e+" "+"重量是"+d);
        System.out.println("Apple和banana的平均重量为："+average+" ");
    }
}
